**Replication codes for "Looks that kill:  Facial metrics and international conflict 1947-2010 "



 
*This is for the faces dyadic data set. Using LTK2025RnROct26.do
 
*Begin with simple analysis  
**start out with sum summary statistics and a histogram of fwhravg1**


use "LTK Research Note Data Final oct17.dta"
*first run the logit
quietly logit mzdispute c.fwhravg_biz1##c.lntentomid1 fwhravg_biz2 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if polrelevant==1, robust cluster(dyad)

*To generate summary statistics and histograms*

sum fwhravg_biz1 if e(sample)==1
hist fwhravg_biz1 if e(sample)==1 
 
hist lntentomid1 if e(sample)==1, frequency bin(6)
 
*now for summary stats for control variables**
**run model first**

quietly logit mzdispute c.fwhravg_biz1##c.lntentomid1 fwhravg_biz2 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if polrelevant==1, robust cluster(dyad)

**Table 2 summary statistics**

outreg2 using summarystats.doc if e(sample), replace sum(log) keep(mzdispute fwhravg_biz1 lntentomid1 relpower   poastrivany joindem dem1 age1  sex1 contig)

**Table 3 Models 


***simple model - polrelevant only ***
logit mzdispute c.fwhravg_biz1##c.lntentomid1 america europe ssafrica mideast  _spline1 _spline2 _spline3 if e(sample) & polrelevant==1, robust cluster(dyad)
outreg2 using   LTKDyadicmay29,  dec(3) excel append ctitle(Simple_Relevant)
margins, dydx(fwhravg_biz1)
margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6))   
marginsplot
graph save Graph "C:\Users\rossa\OneDrive - University of Nebraska\UNL\LTK\LTK Politics and the Life Sciences\RnR Politics and Life Sciences\Figure2June14"


**To compare main marginal effect with base rate of dispute initiation
sum mzdispute
sum mzdispute if polrelevant==1


*now do politically relevant adding domestic and international controls
logit mzdispute c.fwhravg_biz1##c.lntentomid1 fwhravg_biz2 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if polrelevant==1, robust cluster(dyad)
outreg2 using   LTKDyadicmay29,  dec(3) excel append ctitle(Controls_Relevant)
margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) 
marginsplot

*now do all cases

logit mzdispute c.fwhravg_biz1##c.lntentomid1 fwhravg_biz2 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3, robust cluster(dyad)  
margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) 
marginsplot
 

*Here is LSDV.   

logit mzdispute c.fwhravg_biz1##c.lntentomid1  fwhravg_biz2 lntentomid2 relpower poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 i.ccode1 if polrelevant==1, robust cluster(dyad)
outreg2 using   LTKDyadicmay29,  dec(3) excel append ctitle(LSDV)
margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6))  
marginsplot
 
 
 
 **Table 4: Multilevel models.

Note that we are just using a pol relevant version of the leader data set


*"if commands are not allowed with melogit.  So create subset

 ** contrasting melogits - this is nested in dyads
 keep if polrelevant==1
 save polrelevantonly
 melogit mzdispute  c.fwhravg_biz1##c.lntentomid1 fwhravg_biz2 lntentomid2 relpower poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3  || dyad:
 


*nested in dyads, nested in dyads and years. 

melogit mzdispute c.fwhravg_biz1##c.lntentomid1  fwhravg_biz2 lntentomid2 relpower poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 || year: || dyad:





 
*Now for comparative analyses using different conditions
 
*repeat main model - all cases and all controls:  *Now run model across levels of FWHR2 and combine into a single graph.  I exclude fwhravg_biz2.  Estimate on all cases



logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2<1.82, robust cluster(dyad)
outreg2 using   LTKRnRallOct17,  dec(3) excel append ctitle(lowestfwhr2all)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) 
marginsplot
 

*now for mid range (26th-50th pctile)

logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2>=1.8133 & fwhravg_biz2<1.904, robust cluster(dyad)
outreg2 using   LTKRnRallOct17,  dec(3) excel append ctitle(lowerfwhr2all)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6))
marginsplot
 
*now for 50th-75th pctiles

logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2>=1.904 & fwhravg_biz2<2.005872 , robust cluster(dyad)
outreg2 using   LTKRnRallOct17,  dec(3) excel append ctitle(higherfwhr2all)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6))
marginsplot
 
*now for >=75th pctiles

logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2>= 2.005872  & fwhravg_biz2<., robust cluster(dyad)
outreg2 using   LTKRnRallOct17,  dec(3) excel append ctitle(highestfwhr2all)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6))
marginsplot
 


**new code to create a combined marginal plots of all FWHR2 levels
*lowestFWHR2
logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2<1.82, robust cluster(dyad)
 
margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) saving(lowestFWHR2, replace)

*lower FWHR2
logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2>=1.8133 & fwhravg_biz2<1.904, robust cluster(dyad)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) saving(lowerFWHR2)

*higher FWHR2
logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2>=1.904 & fwhravg_biz2<2.005872 , robust cluster(dyad)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) saving(higherFWHR2, replace)

*highest FWHR2

logit mzdispute c.fwhravg_biz1##c.lntentomid1 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3 if  fwhravg_biz2>= 2.005872  & fwhravg_biz2<., robust cluster(dyad)

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) saving(highestFWHR2, replace)


**trying  to combine the plots
combomarginsplot lowestFWHR2 lowerFWHR2 higherFWHR2 highestFWHR2, legend(order("Lowest FWHR2" "Lower FWHR2" "Higher FWHR2" "Highest FWHR2")) plotopts(msymbol(O) msize(small)) ciopts(recast(rcap) lc(gs12)) scheme(s2color) noci


*Now for margins over democracy1 - no confidence intervals in order to see the similarity of the lines

logit mzdispute c.fwhravg_biz1##c.lntentomid1 fwhravg_biz2 lntentomid2 relpower  poastrivany joindem dem1 age1 age2 sex1 sex2 contiguity _spline1 _spline2 _spline3, robust cluster(dyad)  

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) over(dem1)
marginsplot, noci

*and for sex1 - same as above, no confidence intervals

margins, dydx(fwhravg_biz1) at(lntentomid1=(.1(.05)9.6)) over(sex1)
marginsplot, noci







log close
